// core
import App from "@/App.vue"
import router from "@/router"
import "@/router/permission"
import store from "@/store"
import { createApp } from "vue"
// load
import { loadDirectives } from "@/directives"
import { loadSvg } from "@/icons"
import { loadPlugins } from "@/plugins"

import preReClick from "@/utils/preReClick.js"
import "echarts"
import "element-plus/dist/index.css"
import "element-plus/theme-chalk/dark/css-vars.css"
// import "normalize.css"
import VueClipBoard from "vue-clipboard2"
import ECharts from "vue-echarts"
import "vxe-table-plugin-element/dist/style.css"
import "vxe-table/lib/style.css"

// css
import "@/styles/index.scss"
import "element-plus/theme-chalk/display.css"
import MindMapUtil from "./views/super-idea/utils/mind-map"
import i18n from "./views/super-idea/i18n"
const app = createApp(App)

/** 加载插件 */
loadPlugins(app)
/** 加载全局 SVG */
loadSvg(app)
/** 加载自定义指令 */
loadDirectives(app)

app.component("v-chart", ECharts)
app.config.globalProperties.$bus = MindMapUtil.instance
app.use(store),
  app.use(i18n),
  app.use(router),
  app.use(VueClipBoard),
  app.use(preReClick),
  router.isReady().then(() => {
    app.mount("#app")
  })
